vim.g.mapleader = " "

vim.keymap.set("n", "<leader>Ex", vim.cmd.Ex)

-- clear search highlight
vim.keymap.set("n", "<leader><space>", vim.cmd.nohlsearch)

-- set lsp keymaps
vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, {})
vim.keymap.set('n', '<leader>ca', vim.lsp.buf.code_action, {})

-- set diagnostic keymaps
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, {})
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, {})
vim.keymap.set('n', '<leader>q', vim.diagnostic.open_float, {})
vim.keymap.set('n', '<leader>l', vim.diagnostic.setloclist, {})

-- set lsp definition keymaps
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, {})
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, {})
vim.keymap.set('n', '<leader>sh', vim.lsp.buf.signature_help, {})
vim.keymap.set('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, {})
vim.keymap.set('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, {})
vim.keymap.set('n', '<leader>wl', function()
  print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end)


